package com.icangya.DAO.impl;


import com.icangya.DAO.IFbFootGameDAO;
import com.icangya.domain.FbFootGame;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Repository;

import java.util.List;


@Repository
public class FbFootGameDAOImpl extends  BaseDAO<FbFootGame> implements IFbFootGameDAO {

    Logger logger = LoggerFactory.getLogger(this.getClass());

    //获取一个游戏类型的设置
    @Override
    public FbFootGame getFbFootGameByType(int type) {
        String hql="FROM FbFootGame fg where fg.type=?";

        List<FbFootGame> list= (List<FbFootGame>) getHibernateTemplate().find(hql,type);
        if(list.size()>0)
            return list.get(0);
        return null;
    }

    @Override
    public List<FbFootGame> getFbFootGameAll() {

        String hql="FROM FbFootGame fg";
        List<FbFootGame> list= (List<FbFootGame>) getHibernateTemplate().find(hql);
        if(list.size()>0)
            return list;
        return null;
    }
}
